package com.fcscs.cservice.service;

import java.util.List;

import org.springframework.stereotype.Service;

import com.fcscs.cservice.domain.ContactInfo;
import com.fcscs.cservice.domain.GuestProfile;
import com.fcscs.cservice.domain.model.GuestProfileFindView;
import com.fcscs.cservice.domain.model.GuestProfileView;
import com.fcscs.cservice.domain.model.GuestProfileViewForFile;

@Service
public interface GuestProfileManager {

	public List<GuestProfileFindView> findGuestProfile(long propId, String firstName, String lastName, String roomNo, String phoneNo,
			String mobileNo, String memberNo, int start, int resultCnt, boolean inHouseGuestOnly);

	public int findGuestProfileCnt(long propId, String firstName, String lastName, String roomNo, String phoneNo,
			String mobileNo, String memberNo, boolean inHouseGuestOnly);

	/**
	 * get guest profile by id
	 * @param id guest profile
	 * @param cls GuestProfile.class or GuestProfileDetail.class
	 * @return
	 */
	<E extends GuestProfile> E getGuestProfile(long id, Class<E> cls);

	/**
	 * update guest profile
	 * @param guestProfile guest profile to be updated
	 * @return
	 */
	<E extends GuestProfile> E updateGuestProfile(E guestProfile);

	/**
	 * get contact info by id
	 * @param id contact info id
	 * @return
	 */
	ContactInfo getContactInfo(long id);

	/**
	 * update contact info
	 * @param contactInfo contact info to be updated
	 * @return
	 */
	ContactInfo updateContactInfo(ContactInfo contactInfo);

	/**
	 * get GuestProfileView by guest profile id
	 * @param id guest profile id
	 * @return
	 */
	GuestProfileView getGuestProfileView(long id);

	/**
	 * get GuestProfileViewForFile by guest profile id, this api is for pdf generation
	 * @param id guest profile id
	 * @return
	 */
	GuestProfileViewForFile getGuestProfileViewForFile(long id);

	/**
	 * update GuestProfile and ContactInfo (if guestProfileViewId or contactInfoViewId is null, will create)
	 * @param guestProfile the GuestProfileView to be updated or created
	 * @return
	 */
	GuestProfileView updateGuestProfileView(GuestProfileView guestProfile);
}
